<!DOCTYPE html>
<html>
    <head>
		<meta charset="utf-8">
		<title>提现申请列表</title>
		<link rel="stylesheet" href="__ADMIN_PATH__/component/pear/css/pear.css" />
		<style>
			.expand.pear-btn:hover {
				color: currentColor;
                background: none;
			}
			.expand.pear-btn {
				border: 1px solid rgba(255, 255, 255, 0)
			}
		</style>
	</head>
	<body class="pear-container">
	<div class="layui-card-body">
		<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
			<div class="layui-colla-item">
				<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">数据统计</h2>
				<div class="layui-colla-content layui-show">
					<p class="gai">*当前待审核金额共:{$all}</p>
				</div>
			</div>
		</div>
	</div>
		<div class="layui-card">
			<div class="layui-card-body">
				<form class="layui-form" action="">
					<div class="layui-form-item">


						<div class="layui-inline">
							<label class="layui-form-label">申请时间：</label>
							<div class="layui-inline" style="margin-right:0;">
								<div class="layui-input-inline" >
									<input type="text" id="expire_start_time" name="expire_start_time" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-inline"> - </div>
							<div class="layui-inline" style="margin-right:0;">
								<div class="layui-input-inline" style="margin-right:0;">
									<input type="text" id="expire_end_time" name="expire_end_time" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">审核人名称</label>
							<div class="layui-input-inline">
								<input type="text" name="bank_username" placeholder="" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<div class="layui-input-inline">
								<select name="status" lay-verify="">
									<option value="">审核状态</option>
									{foreach name="status_array" item="value"}
									<option value="{$value['value']}">{$value['name']}</option>
									{/foreach}
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<div class="layui-input-inline">
								<select name="city" lay-verify="">
									<option value="">选择城市</option>
									{foreach name="city" item="value"}
									<option value="{$value['shi']}">{$value['company_name']}</option>
									{/foreach}
								</select>
							</div>
						</div>
						<div class="layui-inline" style="margin-left: 50px;">
							<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="search">
								<i class="layui-icon layui-icon-search"></i>
								查询
							</button>
							<button type="reset" class="pear-btn pear-btn-md">
								<i class="layui-icon layui-icon-refresh"></i>
								重置
							</button>
						</div>

					</div>
				</form>
			</div>
		</div>

		<div class="layui-card">
			<div class="layui-card-body">
				<table id="tableId" lay-filter="tableFilter"></table>
			</div>
		</div>

		<script src="__ADMIN_PATH__/component/layui/layui.js"></script>
		<script src="__ADMIN_PATH__/component/pear/pear.js"></script>
		<script>
			layui.use(['table', 'form', 'jquery','common', 'popup', 'loading'], function() {
				let table = layui.table;
				let form = layui.form;
				let $ = layui.jquery;
				let common = layui.common;
				var popup = layui.popup;
				let laydate = layui.laydate;
				let loading = layui.loading;

				let articleTable = table.render({
					elem: '#tableId',
					method: "post",
					url: "{:url('Moneycash/index')}",
					limit: 20,
					page: true,
					even: true,
					skin: 'line',
					toolbar: "#toolbarTpl",
					cols: [[
						{type: "checkbox"},
						{field: "id", title: "ID", width:100, sort: true, align: 'center'},
						{field: "cash_no", title: "单号", width:150},
						{field: "bank_username", title: "姓名", width:100},
						{field: "money", title: "提现金额", width:100},
						{field: "bank_name", title: "平台", width:100},
						{field: "bank_accounts", title: "账号", width:150},
						{field: "city_name", title: "地区", width:150},
						{field: "status_name", title:"审核状态", width:150},
						{field: "add_time_time", title: "申请时间"},
						{field: "zong_time_time", title: "审核时间"},
						{title: "操作", width:150, align: "center", toolbar: "#operationTpl"}
					]],
					done: function (res, curr, count) {
						console.log(res, curr, count)
					}
				});
				//日期时间范围
				laydate.render({
					elem: '#expire_start_time'
					, type: 'datetime'
					,theme: '#1E9FFF'
				});

				laydate.render({
					elem: '#expire_end_time'
					, type: 'datetime'
					,theme: '#1E9FFF'
				});
				form.on('submit(search)', function(data) {
					articleTable.reload({
						where: data.field,
						page: {curr: 1}
					});
					return false;
				});

				table.on("tool(tableFilter)", function (obj) {
					let data = obj.data;
					switch (obj.event) {
						case "audit":
							audit(data.audit_url);
						break;
					}
				});

				function audit(audit_url) {
					layer.open({
						type: 2,
						title: '审核',
						shade: 0.5,
						maxmin:true,
						area: [common.isModile() ? '100%' : '30%', common.isModile() ? '100%' : '30%'],
						content: audit_url
					});
				}
			});
		</script>

		<!-- 行工具栏模板 -->
		<script type="text/html" id="operationTpl">
			{{# if(d.status != 1){ }}
				<button class="pear-btn pear-btn-primary pear-btn-sm" title="审核" lay-event="audit">审核</button>
			{{# } }}
		</script>

	</body>
</html>